home *** CD-ROM | disk | FTP | other *** search
/ PC Open 101 / PC Open 101 CD 1.bin / CD1 / INTERNET / COPIA SITI / Getleft / getleft-setup112-notcl.exe / {app} / doc / Globals.txt < prev    next >
Encoding:
Text File  |  2004-05-18  |  22.3 KB  |  566 lines

  1.  
  2. In this file, you will find all the global variables used in Getleft.
  3.  
  4.  
  5. As usual, this file is Copyright 1999-2002 AndrΘs Garcφa and its contents are
  6. distributed under the terms of the GPL, which means, among other things, that
  7. it comes with no warranty, if the contents of this file blow up your computer
  8. killing some passersby, it will be your sole fault.
  9.  
  10. directories:
  11.     Array with data about the local directories Getleft uses.
  12.         - directories(local): directory of the file Getleft is processing.
  13.         - directories(base): directory where you told Getleft to store the
  14.           download.
  15.  
  16. dirGetleft:
  17.     Array containing the different directories Getleft is in.
  18.         - dirGetleft(main): directory where 'Getleft.tcl' is in.
  19.         - dirGetleft(scripts): where the scripts like 'Ayuda.tcl' are in.
  20.         - dirGetleft(doc): where the documentation is.
  21.         - dirGetleft(images): for the images of the program that are common 
  22.           among themes.
  23.         - dirGetleft(icons): for the images that change between themes.
  24.         - dirGetleft(languages): for the translations of Getleft.
  25.         - dirGetleft(conf): where the logs and such are kept.
  26.         - dirGetleft(lastDir): where the last downloaded site was saved.
  27.         - dirGetleft(toolDir): the directory where we last used the 'Purge
  28.           files' or 'Restore orig' tools.
  29.  
  30. done:
  31.     Not a real global variable, I use it in some dialogs so they can
  32.     grab focus until the value of 'done' changes.
  33.  
  34. errorCode:
  35.     Global variable where Tcl puts error info.
  36.  
  37. getleftState:
  38.     Array with information about Getleft present state:
  39.         - encoding: charset enconding of the first page downloaded.
  40.         - getleftState(autoDown): '1' if Getleft is in full automatic 
  41.           download.
  42.         - getleftState(filesChosen): '1' if the user has already chosen which
  43.           links to download.
  44.         - getleftState(delayedDown): '1' if the download being done has been
  45.           programmed.
  46.         - getleftState(delaySet): '1' if there is a download programed for
  47.           future downloading.
  48.         - getleftState(downloading): '1' if Getleft is downloading a site.
  49.         - getleftState(errorFound):  '1' if there was any error during the
  50.           download.
  51.         - getleftState(mapDone): If the user request a map of the site, this
  52.           will be one  if the map is already done.
  53.         - getleftState(chosenLinks): A list of '0' and '1' representing the
  54.           links chosen in the 'Choose files' dialog.
  55.         - getleftState(mapLinks): A list with links the user told Getleft to
  56.           follow to create the map.
  57.         - getleftState(os): The platform we are in: 'win', 'mac' or 'unix'.
  58.           'mac' means MacOs X, not classic.
  59.         - getleftState(startNow): '1' if the url has to be downloaded as soon
  60.           as the data is entered, '0' if it only has to be in the queue.
  61.         - getleftState(url): The current url being downloaded.
  62.         - getleftState(urlQueue): A list with all the urls that are queued to
  63.           be downloaded.
  64.         - getleftState(urlsToAuto): A list with all the urls that are selected
  65.           to be downloaded in automatic mode.
  66.  
  67. env:
  68.     Global variable in which Tcl keeps the enviromental variables.
  69.  
  70. indexButtons, indexDialgos and indexMenus:
  71.     Arrays, the key of each element is the label of a widget, the content is
  72.     the index of the character of the label that should appear underwriten.
  73.  
  74. labelButtons
  75.     Array with the labels for the buttons in the language chosen by the user.
  76.  
  77. labelDialogs:
  78.     Array with the labels of the dialogs in the language chosen by the user.
  79.  
  80. labelMenus:
  81.     Array with the label of the menus in the language chosen by the user.
  82.  
  83. labelMessages:
  84.     Array with the messages in the language chosen by the user.
  85.  
  86. labelMonths:
  87.     Array with the names of the months in the language chosen by the user.
  88.  
  89. labelTitles:
  90.     Array with the titles of the windows in the language chosen by the user.
  91.  
  92. getleftOptions:
  93.     Array that keeps the user options that affect Getleft behaviour, 
  94.     most are boolean variables.
  95.         - getleftOptions(lang): Code of the language Getleft is using.
  96.         - getleftOptions(pauseNow): Set to '1' when the user want to pause the
  97.           file as it is being downloaded, it is used in case instead of downloading
  98.           we are processing a file.
  99.         - getleftOptions(pauseFile): If '1' downloading will pause after the
  100.               current file.
  101.         - getleftOptions(pausePage): If '1' downloading will stop after getting
  102.               all links in the current page.
  103.         - getleftOptions(proxy): '1' if Getleft should use proxies.
  104.         - getleftOptions(httpProxy): Address and port of the proxy for http
  105.               requests.
  106.         - getleftOptions(ftpProxy):  Address and port of the proxy for ftp
  107.               requests.
  108.         - getleftOptions(sameProxy): '1' if Getleft has to use the same proxy
  109.               for http and ftp.
  110.         - getleftOptions(useAuthProxy): '1' if you need authentificacion to use
  111.               the proxy.
  112.         - getleftOptions(saveAuthPass): '1' if you want Getlef to save your
  113.               password to the proxy.
  114.         - getleftOptions(proxyUser): Your username to the proxy.
  115.         - getleftOptions(proxyPass): and your password.
  116.         - getleftOptions(resumeSites): List with the domains of the sites whose
  117.               download was interrupted and will be completed in the future.
  118.         - getleftOptions(stopPage): If '1' downloading will stop after the
  119.               current page.
  120.         - getleftOptions(stopFile): If '1' downloading will stop after the
  121.               current file.
  122.  
  123. downOptions:
  124.     Array that keeps the user options that affect the current download, 
  125.     most are boolean variables.
  126.         - downOptions(cgi): Whether to follow link to cgi pages.
  127.         - downOptions(dir): If '1' Getleft will download files that are above
  128.               the first one in the directory structure of the remote site.
  129.         - downOptions(exlevels): Number of levels to follow for external sites.
  130.         - downOptions(external): '1' if Getleft should follow links outside
  131.               the site.
  132.         - downOptions(filter): The filter used to decide which files to download.
  133.         - downOptions(images): Takes the values '0', '1', '2' in case you want to
  134.               download all images, only thumbnails or without thumbnails.
  135.         - downOptions(levels): number of levels Getleft will recursively download.
  136.         - downOptions(map): If '1' Getleft will do a map of the site.
  137.         - downOptions(onlyHtml): If '1' only html pages will be downloaded.
  138.         - downOptions(update): Whether the downloading is updating a former one.
  139.  
  140. downOptionsTemp:
  141.     Contains the same info as 'downOptions', it is used when entering a new url in
  142.     the queue, so that we don't pollute the options of the download taking place.
  143.  
  144. defautlDownOptions:
  145.     Contains the same elements as downOptions, it keeps the options set as
  146.     default by the user.
  147.  
  148. siteUrl:
  149.     Array with information about the remote site of the url entered by the user.
  150.         - siteUrl(url):  Url entered by the user.
  151.         - siteUrl(prot): Protocol of the site.
  152.         - siteUrl(www): Name of the site, e.g, www.scriptics.com
  153.         - siteUrl(dir): Directory that holds the file, e.g, /pub. The root
  154.                         directory is represented by an empty string.
  155.         - siteUrl(base): Directory of the file you entered.
  156.  
  157. siteIndex:
  158.     In case we ask Getleft to get the map of the site, when it's done, siteIndex
  159.     is the number of links of the site plus one.
  160.  
  161. siteMap:
  162.     Array with the map of the site, it has a row for every link, the columns:
  163.         - 'level': levels Getleft descended to find that link.
  164.         - 'url': link.
  165.         - 'descrip': description of the link.
  166.  
  167. supportedLang:
  168.     Array with the languages Getleft supports. It keeps the name of
  169.     the language, the two-letter code to identify it, and the encoding
  170.     requiered for its font. For example, for English we have:
  171.         - supportedLang(English) == en
  172.         - supportedLang(en) == iso8859-1
  173.         - supportedLang(langList) List with the names of all the 
  174.           languages to which Getleft has been translated.
  175.  
  176. tcl_platform
  177.     Array in which Tcl keeps the info about the platform it is running in.
  178.  
  179. urlIndex:
  180.     The last Urls entered are keep in the list 'urlHistory', this variable
  181.     keeps the index in which the next url will be entered.
  182.  
  183. urlHistory:
  184.     List with the last urls entered.
  185.  
  186. urlsToDownload:
  187.     An array with information about the urls in the queue:
  188.         - urlsToDownload(the_url_entered): It simply contains a '1' as proof
  189.           we have the data.
  190.         - urlsToDownload(the_url_entered,dir): The directory where it will be 
  191.           stored.
  192.         - urlsToDownload(the_url_entered,resume): How many times it has already
  193.           been resumed.
  194.         - urlsToDownload(the_url_entered,options): A list with the downOptions 
  195.           for the download as given by: array get downOptions.
  196.  
  197.  
  198.  
  199. From now on you will find the variables used in namespaces
  200.  
  201.  
  202.  
  203. In case you are wondering:
  204.     - Ayuda == Help
  205.     - Ccombinado == Cuadro combinado == combobox
  206.     - Descargar == Download
  207.     - Dialogos == Dialogs
  208.     - Herramientas == Tools
  209.     - Ventana == Window
  210.     - Rizo == Curl
  211.     - Progreso == Progress
  212.  
  213. Namespace Ayuda
  214.  
  215. None yet
  216.  
  217. Namespace Herramientas
  218.  
  219. - ip:
  220.     Every element of this array contains the path to one of the entries in which
  221.     you put the network address and port of the proxy.
  222.  
  223. - n:
  224.     In the events of the proxy configuration dialog, 'n' represents the next
  225.     entry.
  226.  
  227. - fileLog:
  228.     - fileLog(file): File with the error log.
  229.     - fileLog(win):  Top level window with the error log.
  230.     - fileLog(text): Path of the text widget where the log is written.
  231.     
  232.  
  233. Namespace Ventana
  234.  
  235. - action
  236.     Either 'head' or 'body' depending on whether Getleft is getting the
  237.     headers or the body of a link.
  238.  
  239. - afterId
  240.     Keeps the handle of the event which updates the progress bar.
  241.  
  242. - file
  243.     File name and path in the local computer of the link being downloaded.
  244.  
  245. - link:
  246.     Link being downloaded.
  247.  
  248. - menus:
  249.     Path of the menus for the 'Pause' and 'Stop' menus buttons.
  250.  
  251. - mother
  252.     Referrer page of the link.
  253.  
  254. - waitingPid
  255.     The identifier of the event to change the title of the downloading
  256.     window while we are waiting after a timout.
  257.  
  258. - window
  259.     Array with the paths of the elements of the downloading window:
  260.         - window(top):    The toplevel path.
  261.         - window(url):    Label with the site domain name.
  262.         - window(dir):    Label with the directory of the file in the remote site.
  263.         - window(file):   Label with the name file.
  264.         - window(left):   Label where the time left of downloding.
  265.         - window(bar):    The path of the progress bar.
  266.         - window(cancel): The path to the cancel button.
  267.         - window(pause):  The path to the pause button.
  268.         - window(resume): The path to the resume button.
  269.  
  270.  
  271. Namespace Rizo
  272.  
  273. - curlError
  274.     In case 'curl' returns an error, this variable will have the error code.
  275.  
  276. - curlReport:
  277.     Array that keeps some information about the download being done by curl:
  278.         - scurlReport(end): curl has finished downloading the link.
  279.         - curlReport(left): In the long reports, curl estimates how much time of
  280.                             downloading is left, this time is kept in this
  281.                             variable.
  282.         - curlReport(nextFile): The contents of this variable are incremented,
  283.                                 when Getleft can start downloading a new link.
  284.                                 It is used in a 'tkwait' statement.
  285.         - curlReport(pause): '1' while the user asks for the downloading to be
  286.                              paused.
  287.         - curlReport(percentage): Percentage of the file downloaded.
  288.         - curlReport(speed): The speed of the downloading.
  289.         - curlReport(stop):  '1' if the user wants to stop the downloading.
  290.  
  291. - errorMessage: Gets the error message raised by 'curl' or the server.
  292.  
  293. - leftIndex and speedIndex
  294.     On version 6.4 curl changed the format of its report, these variables hold
  295.     the place in that report of the time left and the current speed.
  296.  
  297. - meta:
  298.     Array with the headers of the requested link:
  299.         - meta(code): Error code return by the server.
  300.         - meta(content): MIME type of the link, for example "text/html"
  301.         - meta(error): Error message returned by the server.
  302.         - meta(lastModified): Date of the last time the linked file was modified.
  303.                              Unfortunately, some servers don't return this info
  304.                              with the headers.
  305.         - meta(relocate): '1' if the headers say that the link has been relocated.
  306.         - meta(totalBytes): Size of the link
  307.         - meta(versionServer): version of http used by the server.
  308.  
  309. - pipe:
  310.     Handle of the pipe used to write the file.
  311.  
  312.  
  313. Namespace Dialogos
  314.  
  315. This namespace takes care of the dialog used to choose a directory. It is
  316. adapted from a example found in 'Practical Programming in Tcl/Tk' by Brent
  317. Welch (http://www.beedub.com), I made most of the changes to it a few years ago,
  318. when I knew even less about Tcl than I know now, so please, don't blame Mr Welch
  319. for whatever you find there.
  320.  
  321. - fileselect
  322.     Array with information about the elements of the dialog window.
  323.         - fileselect(dir): Current directory.
  324.         - fileselect(dirEnt): Path of the entry widget in which the current
  325.                              directory is shown.
  326.         - fileselect(done): This is used as a marker in a tkwait statement, if
  327.                            it equals '1' the user has entered something, if
  328.                            it equals '0' the user has canceled the action.
  329.         - fileselect(path): Path entered by the user.
  330.         - fileselect(pathEnt): Path of the entry where the user can write the
  331.                               chosen directory.
  332.  
  333.  
  334. Namespace Ccombinado
  335.  
  336. The combobox widget is defined here.
  337.  
  338. - cbArgs
  339.     Array with the parameters passed to the widget:
  340.         - cbArgs(-default): Whatever will appear in the entry when the combobox
  341.                            is mapped
  342.         - cbArgs(-erasable): '1' if the user can delete items from the list, '0'
  343.                             if he can't.
  344.         - cbArgs(-width): Width of the entry in characters.
  345.         - cbArgs(items): List with the items, the one you should check if you
  346.                         allow the user to delete things. It seems that Tcl/Tk
  347.                         8.3 has a variable for this in the ListBox widget
  348.                         but, for the time being, we will have to keep it.
  349.  
  350.  
  351. Namespace HtmlParser
  352.  
  353. - entities: array with the mapping of the Html character entities, for example:
  354.         'entities(lt)==>'
  355.  
  356. - pageEncoding:
  357.     if the page includes the encoding used in a meta tag, this variable will
  358.     have it, otherwise, if will have an empty string.
  359.  
  360. - links:
  361.     array with information about the links found in a page, indexes begin at '1':
  362.         - descrip: The description for the link.
  363.         - file: The link as it appears in the page.
  364.         - type: What kind of link, so far it can be 'image', 'thumb' or nothing
  365.                 at all.
  366.         - ok: boolean, '1' if the file is going to be downloaded, '0' if it has
  367.               been filtered.
  368.         - shown: boolean, '1' if the link is shown in the 'Choose files' dialog.
  369.         - url: The full url of the link.
  370.  
  371. - nLinks:
  372.     Number of links plus one found in the last page processed.
  373.     So if you want to use it, you need something like:
  374.  
  375.     for {set i 1} {$i<$nLinks} {incr i} {}
  376.  
  377.  
  378. Namespace Commands
  379.  
  380. - workFile:
  381.     Array used to load a file into memory, it's structure:
  382.         - workFile(0)=="First line of the file"
  383.         ............
  384.  
  385. - sedChanges:
  386.     Array with the changes that will be applied to the file.
  387.     The 'sed' prefix comes from the time I used to call 'sed' to do this
  388.     job for me. It's structure:
  389.         - sedChanges(0,old)==Regular expresion with the string to change.
  390.         - sedChanges(0,new)==The new string.
  391.  
  392. - sedIndex:
  393.     Index of 'sedChanges' in which the next change to make will be placed.
  394.  
  395. - workFileLines:
  396.     A list with the lines in WorkFile() which contain a '=' sign, here is
  397.     where we will look for links to change. Problem is the links don't have
  398.     to be in the same line of the file, they can be written like:
  399.     <a
  400.     href =
  401.     "link.html">something
  402.     </a>
  403.     Just because I have never seen it, doesn't mean it isn't a bug waiting
  404.     to happen.
  405.  
  406. - startLine:
  407.     Index of the workFileLines list in which Getleft will start trying to
  408.     match the change.
  409.  
  410.             
  411. Namespace Descargar
  412.  
  413. - filesNotFound
  414.     Array where Getleft stores the links which the server refuses to serve,
  415.     like when it doesn't find them or the are forbidden or whatever. They 
  416.     are stored as with 'filesProcessed'
  417.  
  418. - filesProcessed
  419.     Array where Getleft stores which files have already been processed for
  420.     links. The key is the full name of the file, the value is the level of
  421.     recursion in which the link was found. If the levels of recursion are not
  422.     limited Getleft uses this not to process the same file twice, if they are,
  423.     it will process it more than once if it finds it again at a lower level.
  424.     For example:
  425.         set filesProcessed(/home/Andres/download/index.html) 1
  426.  
  427. - filesRelocated
  428.     Array with the urls from the site that are realocated, so that we only
  429.     ask once for them, in the descriptions, 'url' is the original link.
  430.         - filesRelocated(link,url): New url of the link after relocation.
  431.         - filesRelocated(link,ok): Whether to follow it or not.
  432.         - filesRelocated(link,file): The local file for the relocated link.
  433.         - filesRelocated(link,html): Whether the file in html or not.
  434.  
  435. - relocated:
  436.     In case Getleft finds a file that has been relocated, it will put all
  437.     necessary info in this array.
  438.         - relocated(ok): '1' if there has been a relocation.
  439.         - relocated(url): The new file, including path, to download.
  440.  
  441. - updated
  442.     When the 'Update' option is checked this array will keep track of
  443.     the files that have already been updated.
  444.     
  445.     For example, updated(/home/Andres/bounty/images/something.jpg) == 1
  446.  
  447.  
  448. Namespace Progreso
  449.  
  450. - pbArgs:
  451.     Array with data about the progress bars defined, the first index is the
  452.     path of the bar:
  453.         - path,-width:   width of the bar.
  454.         - path,-height:  height of the bar.
  455.         - path,-numbers: '1' if the percentage completed should be shown in the
  456.                        middle of the bar.
  457.         - path,-bg:      background color of the bar.
  458.         - path,-fg:      foreground color of the bar.
  459.         - path,whiteNumber: id of the black text in the middle of the bar.
  460.         - path,blueNumber:  id of the white text in the middle of the bar.
  461.         - path,blackX: X coord of the black text
  462.         - path,blackY: Y coord of the black text
  463.         - path,whiteX: X coord of the white text
  464.         - path,whiteY: Y coord of the white text
  465.  
  466. Namespace Cookies
  467.  
  468. - cookies:
  469.     Array with info about the cookies stored:
  470.         - index,domain:  Site the cookie applies to.
  471.         - index,share:   Whether the cookie is shared among the sites of the domain.
  472.         - index,path:    Path within the domain.
  473.         - index,secure:  Either 'TRUE' or 'FALSE'.
  474.         - index,expires: The moment, in seconds since 1-Jan-1970, the cookies expires.
  475.         - index,cookie:  The name of the cookie.
  476.         - index,value:   The value of the cookie.
  477.  
  478.  
  479. Namespace ChooseFiles
  480.  
  481. activeLink:
  482.     The path to the checkButton where the user right-clicked to show
  483.     the context menu. It is used to know which line to deselect when
  484.     the menu closes.
  485.  
  486. win:
  487.     - win(text): path to the text widget where the links are shown
  488.     - win(menu): path to the context menu.
  489.     - win(top):  path to the toplevel window of the dialog.
  490.  
  491. refererUrl:
  492.     The url of the page from which we have taken the links.
  493.  
  494.  
  495. Namespace mainWin
  496.  
  497. iconImages:
  498.     Array with the images for the icons in the taskbar.
  499.  
  500. mainWin:
  501.     Array with the paths of several elements of the window,
  502.     like the listbox, the scroll bars, ...
  503.  
  504. menus:
  505.     Array with the path of the menus.
  506.  
  507. taskbar:
  508.     Array with the paths of the buttons in the taskbar.
  509.  
  510.  
  511. Namespace getLog
  512.  
  513. fileTaskbar:
  514.     Array with the path of the buttons in the taskbar of the file log.
  515.  
  516. fileLog:
  517.     Array with the path of the elements of the file log toplevel.
  518.  
  519. siteLog:
  520.     Array with the paths of elements of the site log toplevel.
  521.  
  522. siteTaskbar:
  523.     Array with the path of the buttons in the taskbar of the site log.
  524.  
  525. urlLog:
  526.     Array with data about the url in the log.
  527.         - urlLog(urlList): A list with the urls.
  528.         - urlLog($url,localDir): Directory in which the site was saved.
  529.         - urlLog($url,date): Moment in which we finished the download.
  530.         - urlLog($url,options): A list with the options used for the download.
  531.         - urlLog($url,keep): '0' if we can delete it when the log is full.
  532.  
  533.  
  534. Namespace Delay
  535.  
  536. window:
  537.     Array with the path of several widget in the dialog.
  538.         - window(endHour): path of the spinbox with the hour to end.
  539.         - window(endMinute): path of the spinbox with the minute to end.
  540.         - window(startHour): path of the spinbox with the hour to start.
  541.         - window(startMinute): path of the spinbox with the minute to start.
  542.         - window(win): Path of the toplevel window of the dialog.
  543.  
  544. delayedDownload:
  545.     Array with info about the programmed download.
  546.         - delayedDownload(startTime): Time in seconds from '01-01-1970' in which
  547.           the next programmed download will begin.
  548.         - delayedDownload(endTime):  Time in seconds from '01-01-1970' in which
  549.           the programmed download will end.
  550.         - delayedDownload(startEvent): Tcl event that will start the download.
  551.         - delayedDownload(endEvent): Tcl event that will end the download.
  552.         - delayedDownload(noEnd): '1' if there is no time limit.
  553.         - delayedDownload(days): '1' if you define the days in which to download.
  554.         - delayedDownload(how): How the download will stop if there is a time limit:
  555.                 - 0: Inmediately.
  556.                 - 1: After the current file is downloaded.
  557.                 - 2: After all links in the current page are downloaded.
  558.         - delayedDownload(monday): '1' if it will be downloaded on Monday
  559.  
  560. delayedDownloadTemp:
  561.     Array with the same info as 'delayedDownload', this is the one the
  562.     dialog works with, so that if you cancel the dialog, the real one
  563.     won't be polluted with the rejected changes.
  564.  
  565.  
  566.